<script type="text/javascript">
function delPage(id){
	if(confirm("确认删除？")){
		var url = "{:U('portal/Page/doDelete',array('channelId'=>$channelId))}&id="+id;
		window.location = url;
	}	
}

function switchCate(id, obj){
   var display = $('#'+id).css('display');
   if(display=='none') {
      $('#'+id).css('display', '');
	  $(obj).attr('class', 't_s_open');
   } else {
      $('#'+id).css('display', 'none');
	  $(obj).attr('class', 't_s_close');
   }
}
</script>

<div class="tree tree_L">
  <h3 class="tree_tit">{$channelId|getChannelTitle}</h3>

  <php>foreach($cateArr as $key=>$vv){</php>
  
  <ul>
	  <li><span class="t_s_close" onclick="switchCate('ul_{$key}', this)">{$vv}</span>

		  <ul class="tree_tit_C" id="ul_{$key}" style="display:none;">
		  
			<php>$list = $pageList[$key];foreach($list as $key=>$vo){</php>
			<li class="cla" id="ele-{$vo.id}">
			  <php>if($vo['name']!='首页'){</php>
			  <span class="R ml5"><a href="javascript:void(0)" onclick="delPage({$vo.id});return false;">删除</a></span>
			  <php>}</php>
			  <span class="R ml5"><a href="{:U('portal/Page/index',array('channelId'=>$channelId, 'pageId'=>$vo[id]))}">编辑</a></span>
			  <php>if($vo['pageType']!='link'){</php>
			  <span class="R ml5"><a href="{:U('portal/Diy/index', array('channel'=>$channelId, 'page'=>$vo[id], 'diy'=>'1'))}" target="_blank">排版</a></span>
			  <php>}</php> 
			  <php>if($vo['pageType']=='list'){</php>
			  <span class="R ml5"><a href="{:U('portal/Cms/admin',array('channelId'=>$channelId, 'category'=>$vo[id]))}">列表</a></span>
			  <php>}</php>
			  <php>if($vo['pageType']!='link'){</php>		  	  	  
			  <a href="{:U('portal/Diy/index', array('channel'=>$channelId, 'page'=>$vo[id]))}" target="_blank">{$vo.name}</a><em class="pl5">({$vo.readerCount})</em>
			  <php>}else{</php>
			  <a href="{$vo.jumpURL}" target="{$vo.jumpTarget}">{$vo.name}</a>
			  <php>}</php>	
			  </li>
			<php>}</php>
		  </ul>
		  <div class="clear"></div>
	  </li>
  </ul> 
  <php>}</php>  
<p> <a class="add" href="{:U('portal/Page/export','channelId='.$channelId)}">导出浏览量统计</a></p>
</div>
